package com.shoppingwebsite.dao;

import com.shoppingwebsite.domain.YtUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface UserDao {
    //添加一条用户记录
    @Insert("insert into yt_user(password,username,sex,address,telephone) values(#{password},#{username},#{sex},#{address},#{telephone})")
    public int add(YtUser user);

    //根据用户名查询一条用户
    @Select("select *from yt_user where username=#{username}")
    public YtUser select(String username);

    //根据id查询一条用户
    @Select("select *from yt_user where id=#{userId}")
    public YtUser selectById(Integer userId);
}
